package com.woniu.zsd.recycle.controller;


import cn.hutool.core.bean.BeanUtil;
import com.woniu.zsd.common.util.Result;
import com.woniu.zsd.recycle.form.RecordingErrorForm;
import com.woniu.zsd.recycle.param.RecordingErrorParam;
import com.woniu.zsd.recycle.service.ErrorStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 彭于晏
 * @since 2025年02月18日
 */
@RestController
@RequestMapping("/errorStatistics")
@Api(tags = "错误统计")
public class ErrorStatisticsController {
    @Resource
    private ErrorStatisticsService errorStatisticsService;
    @PostMapping("/recordingError")
    @ApiOperation(value = "记录误差")
    public Result recordingError(@RequestBody RecordingErrorForm form)throws Exception{
        errorStatisticsService.recordingError(BeanUtil.toBean(form, RecordingErrorParam.class));
        return Result.success("统计误差成功",null);
    }
}

